package com.system.boot.rbac.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.system.api.rbac.entity.po.SysUserAccount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: lslands
 * @description:
 * @version：v1.0
 * @date: 2024/6/2 22:31
 */
@Mapper
public interface UserAccountMapper extends BaseMapper<SysUserAccount> {
    /**
     * 查询是否重复
     * @param companyId 企业ID
     * @param filed 校验对象字段
     * @param params 被校验的对象值
     * @return boolean
     * @author lslands
     * @date 2024/5/16 00:39
     */
    @Select("SELECT EXISTS(SELECT 1 FROM sys_menu WHERE company_id=#{companyId} AND #{filed}=#{params})")
    boolean getExistsByParams(Long companyId,String filed,String params);

    /**
     * 根据用户ID集查询用户名
     * @param userIds 用户Id集
     * @return 用户名集
     */
    List<String> selectNameByUserIds(List<Long> userIds);
}
